import pygame
from pygame.locals import *
from OpenGL.GL import *
from OpenGL.GLU import *

from world import *

def main():
	world = World()

	pygame.init()
	display = (800,600)
	pygame.display.set_mode(display, DOUBLEBUF|OPENGL)

	gluPerspective(45, (display[0]/display[1]), 0.1, 50.0)
	glTranslatef(0.0, 0.0, -5)

	glEnable(GL_DEPTH_TEST);

	while True:
		for event in pygame.event.get():
			if event.type == pygame.QUIT:
				pygame.quit()
				quit()

#		glRotate(1, 2, 1, 1)
		glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT)
		world.update()
		world.draw()
		pygame.display.flip()
		pygame.time.wait(10)

main()
